namespace game {
    export namespace startup {

        export class InitModuleCommand extends mvc.SimpleCommand {

            public initModules = [
                new gameLogin.GameLoginModule(),
                new gameConfig.GameConfigModule(),
            ];

            public commonModules = [
                new layer.LayerModule(),

            ];
            public async execute(note: mvc.Notification) {
                for (let i = 0; i < this.commonModules.length; i++) this.facade.registerModule(this.commonModules[i]);
                for (let i = 0; i < this.initModules.length; i++) this.facade.registerModule(this.initModules[i]);

                //获取模块初始化的进度
                var progress = note.body.progress;
                progress.current = progress.max = 1;
                //调用模块初始化消息
                this.sendNotification(common.Command.INIT_MODULE, note.body);
                var max = 1;
                if (progress.percent != max) { //如果模块初始化已完成
                    await progress.percentValue.valueEqual(max);
                }
                this.sendNotification(common.Command.CHANGE_SCENE, new common.ChangeSceneNB("gameLogin"));
            }
        }
    }
}